<template>
    <div class='success'>
        <div class="individual">
            <van-image round width="5rem" height="5rem" :src="userData.profile.avatarUrl" />
            <div class="ind-text">
                <p>{{ userData.profile.nickname }}</p>
                <p><span>{{ follows }} 关注</span> <span>{{ followeds }} 粉丝</span> <span>LV.{{ Lv }}</span></p>
            </div>
        </div>
        <div class="myList">
            <van-grid :column-num="4" :border="false">
                <van-grid-item v-for="v in icons" :key="v.title" :icon="v.icon" :text="v.title" @click="gorecent" />
            </van-grid>
            <div class="downloadList"><span><van-icon name="down" /> 下载列表</span><span>13个资源下载失败</span></div>
        </div>
        <div class="collect">
            <p class="header"><span>创建歌单</span><span><van-icon name="plus" /><van-icon name="ellipsis" /></span></p>
            <div class="sheet">
                <div class="sheetImg" v-for="v in Playlist" :key="v.id"
                    @click="$router.push({ name: 'track', params: { id: v.id } })">
                    <div class="sheetImg sheet_r">
                        <van-image radius="15px" width="4rem" height="4rem" :src="v.coverImgUrl" />
                        <div class="sheetText">
                            <p>{{ v.name }}</p>
                            <p>{{ v.trackCount }} 首</p>
                        </div>
                    </div>
                    <van-icon name="ellipsis" />
                </div>

            </div>
        </div>
    </div>
</template>

<script>
import { mapGetters } from "vuex"
export default {
    name: 'success',
    data() {
        return {
            icons: [
                {
                    icon: require('@/assets/a1.png'),
                    title: '最近播放',
                    src: "recent"
                },
                {
                    icon: require('@/assets/a2.png'),
                    title: '本地下载',
                    src: "/recent"
                },
                {
                    icon: require('@/assets/a3.png'),
                    title: '云盘',
                    src: "/recent"
                },
                {
                    icon: require('@/assets/a4.png'),
                    title: '已购',
                    src: "/recent"
                },
                {
                    icon: require('@/assets/a5.png'),
                    title: '我的好友',
                    src: "/recent"
                },
                {
                    icon: require('@/assets/a6.png'),
                    title: '收藏和赞',
                    src: "/recent"
                },
                {
                    icon: require('@/assets/a7.png'),
                    title: '我的播客',
                    src: "/recent"
                },
                {
                    icon: require('@/assets/a8.png'),
                    title: '交友',
                    src: "/recent"
                }
            ],
            show: false,
            showbox: true,
            qrimg: '',
        }
    },
    props: {
        userData: {
            default: {},
            type: Object
        },
        Lv: {
            default: 0,
            type: Number
        },
        followeds: {
            default: 0,
            type: Number
        },
        follows: {
            default: 0,
            type: Number
        },
        Playlist: {
            default: [],
            type: Array
        },
    },
    computed: { ...mapGetters(['xstatus']) },
    components: {},
    created() { },
    mounted() { },
    beforeMount() { },
    methods: {
        gorecent() {
            this.$router.push({ name: 'recent', params: { token: this.xstatus } })
        }
    },
}
</script>
<style scoped>
* {
    margin: 0;
    padding: 0;
}

.individual {
    position: relative;
    top: 5rem;
    background: #fff;
    width: 80%;
    margin: 0 auto;
    text-align: center;
    height: 160px;
    border-radius: 20px;
}

.individual>.van-image {
    position: absolute;
    top: -2.5rem;
    left: 110px;
}

.ind-text {
    padding-top: 60px;
}

.ind-text p {
    margin-top: 15px;
    display: flex;
    justify-content: center;
    line-height: 15px;
}

.ind-text span {
    padding: 0 5px;
}

.myList {
    width: calc(80% - 20px);
    margin: 100px auto 0;
    background: #fff;
    padding: 10px;
    border-radius: 20px;
}

.downloadList {
    display: flex;
    justify-content: space-between;
    margin: 0 auto;
    font-size: 10px;
    color: #777;
}

::v-deep .van-grid-item__content {
    padding: 8px 4px;
}

.collect {
    background: #fff;
    margin: 0 auto;
    padding: 10px 5px;
    width: calc(80% - 20px);
    border-radius: 20px;
    margin-top: 40px;
}

.header {
    display: flex;
    justify-content: space-between;
    padding: 10px;
}

/* .sheet {
    margin-top: 10px;
    display: flex;
    justify-content: space-between;
    padding: 0 10px;
    align-self: center;
} */

.sheetImg {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
}

/* .sheetText {
    display: flex;
    flex-direction: column;
    justify-content: center;
    margin-left: 10px;
} */

.sheetImg>.van-icon {
    line-height: 64px;
    padding-right: 10px;
}

.sheet>h3 {
    text-align: center;
    color: #777;
}

.sheet_r {
    width: 70%;
    justify-content: start;
    padding-left: 8px;
}

.sheetText {
    font-size: 12px;
    width: 120px;
    margin-left: 5px;
}

.sheetText>p {
    height: 16px;
    overflow: hidden;
    line-height: 16px;
    margin-top: 10px;
}

.success {
    padding-bottom: 30px;
}
</style>
